home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1997 May / EnigmA AMIGA RUN 18 (1997)(G.R. Edizioni)(IT)[!][issue 1997-05][EAR-CD II].iso / earcd / misc / emu / arosdev.lha / AROS / workbench / c / delete.c < prev    next >
C/C++ Source or Header  |  1997-01-27  |  655b  |  38 lines

  1. /*
  2.     (C) 1995-97 AROS - The Amiga Replacement OS
  3.     $Id: delete.c,v 1.5 1997/01/27 00:22:36 ldp Exp $
  4.  
  5.     Desc: Delete CLI command
  6.     Lang: english
  7. */
  8.  
  9. #include <exec/memory.h>
  10. #include <exec/execbase.h>
  11. #include <proto/exec.h>
  12. #include <dos/dos.h>
  13. #include <proto/dos.h>
  14. #include <utility/tagitem.h>
  15.  
  16. int main (int argc, char ** argv)
  17. {
  18.     STRPTR args[1]={ 0 };
  19.     struct RDArgs *rda;
  20.     LONG error=0;
  21.  
  22.     rda=ReadArgs("FILE/A",(IPTR *)args,NULL);
  23.  
  24.     if(rda!=NULL)
  25.     {
  26.     if (!DeleteFile(args[0]))
  27.         error = RETURN_ERROR;
  28.  
  29.     FreeArgs(rda);
  30.     }
  31.     else
  32.     error=RETURN_FAIL;
  33.  
  34.     if(error)
  35.     PrintFault(IoErr(),"Delete");
  36.     return error;
  37. }
  38.